summaryrefslogtreecommitdiffstats
path: root/chello
diff options
context:
space:
mode:
Diffstat (limited to 'chello')
-rw-r--r--chello/CMakeLists.txt16
1 files changed, 3 insertions, 13 deletions
diff --git a/chello/CMakeLists.txt b/chello/CMakeLists.txt
index f7a276f..c48ba4b 100644
--- a/chello/CMakeLists.txt
+++ b/chello/CMakeLists.txt
@@ -1,15 +1,5 @@
-find_program(CMAKE_C_COMPILER NAMES gcc cc)
-if(NOT CMAKE_C_COMPILER)
- message(FATAL_ERROR "C compiler not found!")
-endif()
+add_library(hello_c SHARED hello.c)
-set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/libhello_c.so)
-
-add_custom_command(
- OUTPUT ${OUTPUT_FILE}
- COMMAND ${CMAKE_C_COMPILER} -shared -fPIC -o ${OUTPUT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/hello.c
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/hello.c
- COMMENT "Compiling hello_c shared library..."
+set_target_properties(hello_c PROPERTIES
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)
-
-add_custom_target(hello_c ALL DEPENDS ${OUTPUT_FILE})