Skip to content

Commit

Permalink
Update cmake to use env vars
Browse files Browse the repository at this point in the history
Should work with brew
  • Loading branch information
posva committed Feb 2, 2017
1 parent c6fb520 commit 4776262
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.8)
project(catimg)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

# set soem options
if (DEFINED ENV{man1})
set(INSTALL_MAN $ENV{man1})
else()
set(INSTALL_MAN "/share/man/man1")
endif()

# set some options
#set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -g -std=c99 -Wno-unused-result")
#set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -Os -std=c99 -Wno-unused-result")
Expand All @@ -28,12 +34,12 @@ add_executable(
install(TARGETS catimg
RUNTIME DESTINATION bin)

# libs
target_link_libraries(catimg m)

# man page
install(FILES ${PROJECT_SOURCE_DIR}/man/catimg.1
DESTINATION share/man/man1)
DESTINATION ${INSTALL_MAN})

# libs
target_link_libraries(catimg m)

# tests
#enable_testing()
Expand Down

0 comments on commit 4776262

Please sign in to comment.